package com.slipper.system.codeless.controller;

import com.slipper.system.codeless.bo.ScriptGroovyHistoryBO;
import com.slipper.system.codeless.service.ScriptGroovyHistoryService;
import com.slipper.util.ResultUtil;
import com.slipper.util.Tool;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 脚本历史表
 */
@RestController
@RequestMapping("/system/scriptGroovyHistory")
public class ScriptGroovyHistoryController {
    @Resource
    private ScriptGroovyHistoryService scriptGroovyHistoryService;
    
    @PostMapping(value = "/queryBy")
    public String queryBy(@RequestBody ScriptGroovyHistoryBO bo) {
        if(Tool.isBlank(bo.getId())) {
            return ResultUtil.failureResult("数据获取失败！");
        }
        return ResultUtil.successResult(scriptGroovyHistoryService.queryBy(bo.getId()));
    }

    @PostMapping(value = "/queryList")
    public String queryList(@RequestBody ScriptGroovyHistoryBO bo) {
        return ResultUtil.successResult(scriptGroovyHistoryService.queryList(bo));
    }
}
